home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
lisp
/
eulisp
/
mpfeel.lha
/
MPFeel
/
Plurals
/
mp_mem_mgmt.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-29
|
2KB
|
78 lines
/*
* Plurals
*
* Author: S.C.Merrall
*
* File: mp_mem_mgmt.h
*
* Contents:
*
* Description:
*
* Change History:
*
* Date Name Comment
* -------- ---- -------
* 21:02:91 SCM Created
* 15:04:91 SCM Allocate data in 32 bit blocks
* 16:05:91 SCM alloc_lispobject moved to mp_alloc.h
* 16:05:91 SCM heap_memory moved to mp_gc.h
* 21:05:91 SCM alloc_plural added (no longer visible)
* 25:06:91 SCM Removed memory size definition - compile-time determined
* 04:06:91 SCM Heap Header now 16-bits
*
*/
#define MEMORY_SIZE (MEMORY_SIZE_IN_BYTES/sizeof(heap_header))
/* 8K in 32 bit words */
#define TOP ((MEMORY_SIZE_IN_BYTES/sizeof(natural))-1)
/* Highest index in 16 bit words */
/* #define heap2plural(x) (2*(x)) Convert heap offsets to plural offsets
* #define plural2heap(x) ((x)/2)
*/
#define heap2plural(x) (x)
#define plural2heap(x) (x)
#define byte2heap(x) ((x)/sizeof(heap_header))
#define heap2byte(x) (sizeof(heap_header)*(x))
#define byte2plural(x) ((x)/sizeof(natural))
#define plural2byte(x) (sizeof(natural)*(x))
#define space_to_grow(for_n_bytes) globalor((plural_space - heap2plural(heap_space)) > (1 + byte2plural(for_n_bytes)))
#define FREE_FLAG (natural)0x8000
#define Free_P(x) (x==FREE_FLAG)
#define Null_P(x) (x==NIL)
/* #define HEAP_BLOCK_SIZE 4 size of heap allocation blocks in bytes */
/* typedef unsigned char byte; */
/* extern plural natural plural_memory[]; */
extern plural natural *plural plural_memory;
extern plural heap_header heap_memory[];
extern natural plural_space;
extern plural natural heap_space;
/* extern plural char scratch[]; */
#ifdef __STDC__
extern natural alloc_plural( object, int )
#else
extern natural alloc_plural();
#endif